package com.itheima.mapper;

import com.github.pagehelper.Page;
import com.itheima.domain.*;
import com.itheima.entity.PageCondition;
import com.itheima.domain.Setmeal;
import com.itheima.entity.Result;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderMapper {
    public void add(Order order);

    public List<Order> findByCondition(Order order);

    public Map findById4Detail(Integer id);

    public Integer findOrderCountByDate(String date);

    public Integer findOrderCountAfterDate(String date);

    public Integer findVisitsCountByDate(String date);

    public Integer findVisitsCountAfterDate(String date);

    public List<Map> findHotSetmeal();


    /*查询所有的套餐*/
    List<Setmeal> findSetmeal();

    /*查询全部预约数据*/
    Page<Order> findAll();

    /*条件查询*/
    Page<Order> findAllByCondition(PageCondition pageCondition);

    /*删除预约数据*/
    void delete(Integer id);

    /*查询预约状态*/
    Order findStatusById(Integer id);

    /*修改预约状态*/
    void updateStatus(Integer id);
    void updateStatusTo(Integer id);

    /*根据id查询预约数据*/
    Map findOrderById(Integer id);

    /*查询关联id*/
    List<Integer> findSetmealId(Integer id);

    void deleteByMemberId(int memberId);

    /*更新预约数据*/
    void update(Order order);
    /*更新预约数据*/
    void resultByUpdate(Order order);


    List<Setmeal> findSetmealById(Integer id);

    List<Setmeal> findSetmealByIdAndDate(@Param("memberId") String memberId,@Param("startDate") String startDate,@Param("endDate") String endDate);

    void statusEdit(Order order);

    //健康干预查询所有预约信息
    Page<OrderList> selectByCondition(String queryString);

    /*判断用户是否重复预约*/
    List<Order> findByMember(Order order);
}
